package com.lykj.llw.box.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lykj.llw.box.R
import com.lykj.llw.box.data.bean.response.MyBillingListResponse

/**
 * ================================================
 * 我的账单页面列表适配器
 * ================================================
 *
 * @author gosha
 * @date 2023/10/16-16:30
 */
class MyBillingAdapter :
    BaseQuickAdapter<MyBillingListResponse.DataDTO.RowsDTO, BaseViewHolder>(R.layout.item_my_billing) {
    override fun convert(holder: BaseViewHolder, item: MyBillingListResponse.DataDTO.RowsDTO) {
        holder.setText(R.id.tv_title, "${item.subject}")

        holder.setText(R.id.tv_time, "${item.ctimeStr}")

        if (item.type == 1) {
            holder.setText(R.id.tv_amount, "+${item.updateMoney}")
        } else {
            holder.setText(R.id.tv_amount, "-${item.updateMoney}")
        }
    }
}